package com.triones.yjj.controller.web;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.triones.yjj.entity.bo.MemberWithdrawParams;
import com.triones.yjj.entity.bo.RemainderListParams;
import com.triones.yjj.entity.bo.WaitSettlementListParams;
import com.triones.yjj.entity.bo.WithdrawalListParams;
import com.triones.yjj.entity.vo.MemberWithdrawListVO;
import com.triones.yjj.entity.vo.RemainderDetailListVO;
import com.triones.yjj.entity.vo.WaitSettlementRecordVO;
import com.triones.yjj.entity.vo.WithdrawalRecordVO;
import com.triones.yjj.service.OrderTradeService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 资金管理
 *
 * @Author: triones
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/amount")
public class OrderTradeController extends BaseController {

    private final OrderTradeService orderTradeService;

    /**
     * 余额明细列表（分页）
     */
    @GetMapping("/remainder/pageList")
    public TableDataInfo<RemainderDetailListVO> remainderPageList(RemainderListParams params, PageQuery pageQuery) {
        return orderTradeService.remainderPageList(params, pageQuery);
    }

    /**
     * 待结算明细（分页）
     */
    @GetMapping("/waitSettlement/pageList")
    public TableDataInfo<WaitSettlementRecordVO> waitSettlementDetailList(WaitSettlementListParams params, PageQuery pageQuery) {
        return orderTradeService.waitSettlementDetailList(params, pageQuery);
    }

    /**
     * 资金管理数据统计
     */
    @GetMapping("/stats")
    public R<Map> stats() {
        return R.ok(orderTradeService.stats());
    }

    /**
     * 客户提现申请列表（分页）
     */
    @GetMapping("/memberWithdraw/pageList")
    public TableDataInfo<MemberWithdrawListVO> memberWithdrawPageList(MemberWithdrawParams params, PageQuery pageQuery) {
        return orderTradeService.memberWithdrawPageList(params, pageQuery);
    }
}
